/* What do we want to do - Kill or Accept an address */
Address THOR.01
REQUESTNOTIFY TEXT '"'vers'\n\n Do you wish to add this address to\n the ''Kill'' or the ''Accept'' section?\n\n'addr'\n" BT "_Kill|_Accept|_Cancel"'
If Result=0 Then Exit
If Result=1 Then
Do
Dest="'Kill'"
Call Kill
End
If Result=2 Then
Do
Dest="'Accept'"
Call Accept
End
/* let's write the new configuration file */
Call Open(newfile,'UULib:SMTP.conf',w)
Call Writeln(newfile,txt2)
/* Let's tell the user what we have done */
Address THOR.01
REQUESTNOTIFY TEXT '"'vers'\n\n The following EMail address has been\n added to the 'dest' section of the\n GetMail configuration file.\n\n'addr'\n" BT "_Thank You"'
Exit
/* Let's find the end of the 'Kill Addresses' section and insert the new address */
Kill:
Call Check
Do x=1 To lines
If txt.x="# Allowed Addresses" Then
Do
x=x-1
Leave
End
End
bar=Length(txt.x)+3
pos=Index(txt,"# Allowed Addresses")
insertpos=pos-bar
txt2=Insert(addr||lf,txt,insertpos)
Return
/* Let's find the end of the 'Allowed Addresses' section and insert the new address */
Accept:
Call Check
insertpos=Index(txt,"# EOF")-2
txt2=Insert(addr||lf,txt,insertpos)
Return
/* Let's make sure that the user really wants to do this */
Check:
Address THOR.01
REQUESTNOTIFY TEXT '"'vers'\n\n Are you sure that you wish to\n add the following EMail address\n to the 'dest' section of the\n GetMail configuration file?\n\n'addr'\n" BT "_Positive!|Perhaps Not"'
If Result=0 Then Exit
Return
Syntax:
Address THOR.01
REQUESTNOTIFY TEXT '"'vers'\n\nA syntax error ('RC') occurred.\n'ErrorText(RC)'\nin line 'SIGL'" BT "_Exit"'
Exit
Return
BBSError:
Address THOR.01
REQUESTNOTIFY TEXT '"'vers'\n\nBBSREAD ERROR\n'BBSREAD.LASTERROR'" BT "_Exit"'